<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('type_id')->default(0)->comment('分类id');
            $table->string('title')->default('')->comment('标题');
            $table->string('author')->default('')->comment('作者');
            $table->mediumText('content')->comment('主体');
            $table->string('keywords')->default('')->comment('标签');
            $table->string('cover')->default('')->comment('封面');
            $table->boolean('is_top')->default(0)->comment('是否置顶 1=是 0=否');
            $table->integer('status')->default(0)->comment('状态');
            $table->string('tag_ids')->default('')->comment('标签');
            $table->integer('openness')->default(1)->comment('是否公开 0=否 1=是');
            $table->integer('click')->unsigned()->default(0)->comment('点击数');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('articles');
    }
}
